using System;
using System.Text;
using System.Windows.Forms;
using Reflector;
using Reflector.CodeModel;
using Reflector.CodeModel.Memory;

namespace LanguageWriterHelper
{
    /// <summary>
    /// LanguageWriterHelper Addin package class to allow loading by Reflector.
    /// </summary>
    internal class Package : IPackage
    {
        private ILanguageManager languageManager;
        private ILanguage language;

        /// <summary>
        /// Loads the specified service provider.
        /// </summary>
        /// <param name="serviceProvider">The service provider.</param>
        public void Load(IServiceProvider serviceProvider)
        {
            this.languageManager = (ILanguageManager)serviceProvider.GetService(typeof(ILanguageManager));
            language = new Language();
            languageManager.RegisterLanguage(language);
        }

        /// <summary>
        /// Unloads this instance.
        /// </summary>
        public void Unload()
        {
            languageManager.UnregisterLanguage(language);
        }

    }
}
